/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package BaseDatos;

/**
 *
 * @author Maurinho
 */
import java.sql.*;
public class Conexion {
    public Connection conectar()
    {
        Connection cn = null;
        try
        {
            String DSN="jdbc:mysql://localhost/sistemaexamen"; 
            String user="root"; 
            String password="";
            Class.forName("com.mysql.jdbc.Driver");
                cn = DriverManager.getConnection(DSN,user,password);
        }
        catch(Exception ex)
        {
            System.out.println("Error1: " + ex.getMessage());
        }
        return cn;
    }
}
